package com.yanqu.road.server.gameplayer.module.activity.tomb.entity;

import com.yanqu.road.dao.dbV2.BaseEntity;
import com.yanqu.road.dao.dbV2.IField;
import com.yanqu.road.dao.dbV2.ITable;
import com.yanqu.road.dao.dbV2.serializer.DInt;
import com.yanqu.road.dao.dbV2.serializer.DLong;
import com.yanqu.road.dao.dbV2.serializer.DObject;

import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;

@ITable(tableName = "t_u_activity_tomb_info")
public class DbTombInfo extends BaseEntity {

    public static DbTombInfo newInstance() {
        return new DbTombInfo();
    }

    @IField(isPrimaryKey = true, fieldName = "user_id", comment = "用户ID", serializer = DLong.class)
    public long userId;

    @IField(isPrimaryKey = true, fieldName = "activity_id", comment = "活动id", serializer = DInt.class)
    public int activityId;


    @IField(fieldName = "partner_id_list", comment = "锁定门客列表", serializer = DObject.class)
    public Set<Integer> partnerIdList = new HashSet<>();

    @IField(fieldName = "chose_event_finish", comment = "二选一事件正确选择过", serializer = DObject.class)
    public Set<Integer> choseEventFinish = new HashSet<>();

    /**
     * 人偶数据
     */
    private ConcurrentHashMap<Integer, Long> dollMap = new ConcurrentHashMap<>();

    @IField(fieldName = "score", comment = "个人积分", serializer = DLong.class)
    public long score;

    @IField(fieldName = "union_score", comment = "商会积分", serializer = DLong.class)
    public long unionScore;


    @IField(fieldName = "item_map", comment = "打理物品背包", serializer = DLong.class)
    public Map<Integer, Long> takeCareItemMap = new ConcurrentHashMap<>();

    private boolean isOldActivityIdZero = false;

    public int getActivityId() {
        return activityId;
    }

    public void setActivityId(int activityId) {
        this.activityId = activityId;
        if (0 == this.activityId){
            isOldActivityIdZero = true;
        }
    }

    public long getUserId() {
        return userId;
    }

    public void setUserId(long userId) {
        this.userId = userId;
    }

    public boolean isOldActivityIdZero() {
        return isOldActivityIdZero;
    }

    public void setOldActivityIdZero(boolean oldActivityIdZero) {
        isOldActivityIdZero = oldActivityIdZero;
    }

    public Set<Integer> getPartnerIdList() {
        return partnerIdList;
    }

    public void setPartnerIdList(Set<Integer> partnerIdList) {
        this.partnerIdList = partnerIdList;
    }

    public Set<Integer> getChoseEventFinish() {
        return choseEventFinish;
    }

    public void setChoseEventFinish(Set<Integer> choseEventFinish) {
        this.choseEventFinish = choseEventFinish;
    }

    public long getScore() {
        return score;
    }
    public void setScore(long score) {
        this.score = score;
    }

    public long getUnionScore() {
        return unionScore;
    }

    public void setUnionScore(long unionScore) {
        this.unionScore = unionScore;
    }

    public Map<Integer, Long> getTakeCareItemMap() {
        return takeCareItemMap;
    }

    public void setTakeCareItemMap(Map<Integer, Long> takeCareItemMap) {
        this.takeCareItemMap = takeCareItemMap;
    }

    public ConcurrentHashMap<Integer, Long> getDollMap() {
        return dollMap;
    }

    public void setDollMap(ConcurrentHashMap<Integer, Long> dollMap) {
        this.dollMap = dollMap;
    }
}
